This repository was archived by the owner on Nov 8, 2022. It is now read-only.
fixed issue 1716: No third party error handling in loading plugin RES…#1717
Open
candysmurf wants to merge 1 commit intointelsdi-x:masterfrom
Open
fixed issue 1716: No third party error handling in loading plugin RES…#1717candysmurf wants to merge 1 commit intointelsdi-x:masterfrom
candysmurf wants to merge 1 commit intointelsdi-x:masterfrom
Conversation
|
Tested your changes (regenerated client-go and CLI) and it seems that go-swagger have some bug (I am using latest swagger release 0.11.0). When no response code provided, default response code is 200, so the client returns ...
default:
result := NewLoadPluginDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil <---------------- HERE
}
return nil, result
}but in func (a *Client) LoadPlugin(params *LoadPluginParams, authInfo runtime.ClientAuthInfoWriter) (*LoadPluginCreated, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewLoadPluginParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "loadPlugin",
Method: "POST",
PathPattern: "/plugins",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"multipart/form-data"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &LoadPluginReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*LoadPluginCreated), nil <--------------- HERE
}In result, when something go wrong, CLI will throw: |
Contributor
Author
|
@mkleina, thanks for the review. May I know the steps to reproduce the error you had? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1716
Summary of changes:
Testing done:
@intelsdi-x/snap-maintainers